<template>
  <div v-if="is_info" style="max-width: 100%;white-space: pre-wrap;text-align: left;justify-content: flex-start;">{{value}}</div>
  <div v-else class="form_item-text_more">
    <el-input :name="name" v-model="this_value" :size="size" @change="update_value" type="textarea" :rows="5" style="width: 100%"></el-input>
  </div>
</template>

<script>
export default {
  _title_: '多行文本',
  _can_config_: true,
  _can_form_param_public_: true,
  _can_form_param_: true,
  name: "text_more",
  props: ['name', 'value', 'config', 'is_info', 'size', 'is_list'],
  emits: ['update:value', 'change'],
  data(){
    return {
      need_display: true,
      this_value: this.value,
    }
  },
  methods: {
    update_value(v){
      this.need_display = false;
      setTimeout(()=>{this.need_display = true;},5);
      this.$emit('update:value', v);
      this.$emit('change', v);
    },
  },
  watch: {
    value(){
      if (!this.need_display) return;
      this.this_value = this.value;
    }
  },
}
</script>

<style scoped>

</style>